/*
 * @Author: gonghairun
 * @Date: 2020-11-14 16:23:20
 * @LastEditors: yyr 1478439771@qq.com
 * @LastEditTime: 2022-10-10 16:27:42
 * @Description: //描述
 */

import Vue from 'vue'
import App from './App'
import { router } from './router/index'
import './plugins/element.js'
import './assets/iconfonts/iconfont.css'
import './assets/newIconFonts/iconfont.css'

import md5 from 'js-md5'
import TreeTable from 'vue-table-with-tree-grid'
import store from './store'
import LemonIMUI from 'lemon-imui'
import 'lemon-imui/dist/index.css'
Vue.use(LemonIMUI)
import { Button, Col, Card, Icon, Input, InputNumber, Modal, Popconfirm, Popover, Progress, Radio, Row, Select, Slider, Spin, Switch, Space } from 'ant-design-vue';
console.log(Button, 'Button');
const components = [
  Button,
  Col,
  Card,
  Icon,
  Input,
  InputNumber,
  Modal,
  Popconfirm,
  Popover,
  Progress,
  Radio,
  Row,
  Select,
  Slider,
  Spin,
  Switch,
  Space
];
components.map(component => {
  Vue.use(component);
})

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

import Storage from 'vue-ls'
const options = {
  namespace: 'hiPrint-',
  name: 'ls',
  storage: 'local'
};
Vue.use(Storage, options);
// import tableMove from './libs/tableMove' //表格拖动指令
import directive from './libs/directive' // 自定义指令插件
Vue.prototype.$md5 = md5
// Vue.directive('tableMove',tableMove)
Vue.use(directive)
import { Service } from './network/http.js'
Vue.prototype.$http = Service
import { version } from './network/http.js'
Vue.prototype.$version = version
import { ServiceName } from './network/http.js'
Vue.prototype.$ServiceName = ServiceName

import verify from '@/plugins/verify.js'
import { exportExcel } from '@/assets/js/exportExcel.js'

// 引入hiprint
import { hiPrintPlugin } from '@/components/print/index.js'
Vue.use(hiPrintPlugin)

Vue.prototype.verifyfilter = verify.filter

Vue.prototype.verifyrule = verify.rule

Vue.prototype.cuHeight = verify.cuHeight

Vue.prototype.$exportExcel = exportExcel

import './plugins/formRules.js'

Vue.component('tree-table', TreeTable)

import echarts from 'echarts'
Vue.prototype.$echarts = echarts

// if (!process.env.IS_WEB) Vue.use(require('vue-electron'))

// Vue.config.productionTip = false
// process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true'

// 引用全局过滤器
import dfilters from '@/libs/Utils.js'

import '@/ef/index.css'

import Print from 'vue-print-nb'
Vue.use(Print); // 注册

import JsonExcel from 'vue-json-excel'
Vue.component('downloadExcel', JsonExcel)

// 将全局过滤器注册到当前页面的Vue中
Object.keys(dfilters).forEach(key => {
  // console.log(filters[key])
  Vue.filter(key, dfilters[key])
  Vue.prototype[key] = dfilters[key]
})

new Vue({
  el: '#app',
  router: router,
  store: store,
  beforeCreate() {
    // this就是Vue实例对象vm   ,vm上有$on,$emit,$off，直接用它就行
    Vue.prototype.$bus = this // 安装全局事件总线
  },
  render: h => h(App)
})
